VERSION_FILE = 'include/siri/version.h'
CHANGELOG_FILE = 'ChangeLog'
+
def _version_levels():
for n in ('MAJOR', 'MINOR', 'PATCH'):
yield re.compile('^#define SIRIDB_VERSION_{} ([0-9]+)$'.format(n))
+
def _get_version():
version_gen = _version_levels()
version_m = next(version_gen)
raise ValueError('Cannot find version in {}'.format(VERSION_FILE))
+
def _get_changelog(version):
with open('ChangeLog-{}'.format(version), 'r') as f:
content = f.read()
raise ValueError('Changelog required!')
return content
+
def _get_distribution():
'''Returns distribution code name. (Ubuntu)'''
proc = subprocess.Popen(['lsb_release', '-c'], stdout=subprocess.PIPE)
os.chmod(rules_file, os.stat(rules_file).st_mode | stat.S_IEXEC)
with open(os.path.join(debian_path, 'links'), 'w') as f:
- f.write('/usr/lib/siridb/server/{package} /usr/local/bin/{package}\n'.format(
- **config))
+ f.write(
+ '/usr/lib/siridb/server/{package} /usr/local/bin/{package}\n'
+ .format(**config))
with open(os.path.join(debian_path, 'install'), 'w') as f:
f.write('''src/usr /
result['series'].sort()
self.assertEqual(
result,
- { 'columns': ['name', 'length', 'type', 'start', 'end'],
+ {
+ 'columns': ['name', 'length', 'type', 'start', 'end'],
'series': [
[
'series float',